package com.cmsky.open.cms.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import com.cmsky.open.core.base.*;
import com.cmsky.open.core.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.cmsky.open.cms.model.*;
import com.cmsky.open.cms.dao.*;
import com.cmsky.open.cms.manager.*;
import com.cmsky.open.cms.vo.query.*;

/**
 * @author jandyfish email:jandyfish(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class CmsNodePropertyInfo extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "CmsNodePropertyInfo";
	public static final String ALIAS_ID = "编号";
	public static final String ALIAS_NAME = "属性值";
	public static final String ALIAS_VAL = "属性值";
	public static final String ALIAS_NID = "节点";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 编号       db_column: id 
     */	
	
	private java.lang.Integer id;
    /**
     * 属性值       db_column: name 
     */	
	@NotBlank @Length(max=20)
	private java.lang.String name;
    /**
     * 属性值       db_column: val 
     */	
	@NotBlank @Length(max=50)
	private java.lang.String val;
    /**
     * 节点       db_column: nid 
     */	
	@NotNull 
	private java.lang.Integer nid;
	//columns END

	public CmsNodePropertyInfo(){
	}

	public CmsNodePropertyInfo(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	public java.lang.String getName() {
		return this.name;
	}
	public void setVal(java.lang.String value) {
		this.val = value;
	}
	
	public java.lang.String getVal() {
		return this.val;
	}
	public void setNid(java.lang.Integer value) {
		this.nid = value;
	}
	
	public java.lang.Integer getNid() {
		return this.nid;
	}
	
	private CmsNodeInfo cmsNodeInfo;
	
	public void setCmsNodeInfo(CmsNodeInfo cmsNodeInfo){
		this.cmsNodeInfo = cmsNodeInfo;
	}
	
	public CmsNodeInfo getCmsNodeInfo() {
		return cmsNodeInfo;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Name",getName())
			.append("Val",getVal())
			.append("Nid",getNid())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof CmsNodePropertyInfo == false) return false;
		if(this == obj) return true;
		CmsNodePropertyInfo other = (CmsNodePropertyInfo)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.append(getName(),other.getName())
			.append(getVal(),other.getVal())
			.append(getNid(),other.getNid())
			.isEquals();
	}
}

